
define(["jquery","template","as/app/gms/gmsDetail.servers","as/template/gms/gmsDetail.tpl"],function ($,template,$servers,tpl) {
    var ui = {};

    var drawHistory = function(data){
        return template("tpl_gmsDetail_history",data)
    };
    ui.history = function(options){
        $( "#" + options.id ).html( tpl.history() );
        var h = drawHistory( options );
        $( "#" + options.id ).html(h);
    };

    var drawInfo = function(data){
        return template("tpl_gmsDetail_info",data)
    };
    ui.info = function(options){
        $( "#" + options.id ).html( tpl.info() );
        var h = drawInfo( $servers.handleInfo(options.data) );
        $( "#" + options.id ).html(h);
    };

    var drawPrintInfo = function(data){
        return template("tpl_gmsDetail_printInfo",data)
    };
    ui.printInfo = function(options){
        $( "#" + options.id ).html( tpl.printInfo() );
        var h = drawPrintInfo( $servers.handleInfo(options.data) );
        $( "#" + options.id ).html(h);
    };

    return ui;
});